package com.wangxiang.sys.manage.utils;

import com.wangxiang.sys.manage.dao.LoginDao;
import com.wangxiang.sys.manage.dao.SysAuthDao;
import com.wangxiang.sys.manage.entity.LoginEntity;
import com.wangxiang.sys.manage.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Component
public class SysAuthUtils {
    @Autowired
    private LoginService loginService;
    @Autowired
    private SysAuthDao sysAuthDao;
    public List<Object> getSysAuth(int userId){

        /**
         * 基础权限
         */
        List<Object> list = loginService.getSysAuth(userId);
        /**
         * 权限框架重构
         * 附加权限
         */
        List<Object> auth = sysAuthDao.selectAuthByPk1(userId);
        auth.forEach((item) ->{
            list.add(item);
        });



        System.out.println("权限工具auth==="+list);
        return list;
    }

}
